package com.vito.framework.system.notice.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vito.framework.base.exception.CommonException;
import com.vito.framework.base.service.impl.BaseServiceImpl;
import com.vito.framework.system.notice.mapper.NoticeMapper;
import com.vito.framework.system.notice.model.NoticeBean;
import com.vito.framework.system.notice.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, NoticeBean> implements NoticeService {

	@Autowired
	NoticeMapper noticeMapper;

	@Override
	public IPage<NoticeBean> getNoticeList(Page<NoticeBean> page, Map<String, Object> paramMap)
			throws CommonException {
		return noticeMapper.getNoticeList(page, paramMap);
	}

	@Override
	public void editNoticeReadFlag(NoticeBean noticeBean) throws CommonException {
		noticeMapper.updateNoticeReadFlag(noticeBean);
	}

	@Override
	public List<NoticeBean> noticeList(Map<String, Object> paramMap) throws CommonException {
		return noticeMapper.noticeList(paramMap);
	}

	@Override
	public NoticeBean getById(String noticeId) throws CommonException {
		return noticeMapper.getNotice(noticeId);
	}
}
